//
//  NHUtils.h
//  MUBATE
//
//  Created by sunbin on 2017/2/14.
//  Copyright © 2017年 Quanli. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface NHUtils : NSObject
// 设置按钮属性
/* @param btn     按钮
 * @param launch  是否启动页面（注册登录）
 * @param title   显示标题
 * @param radius  设置圆角
 * @param Fon     字号
 */
+ (void)setButton:(UIButton *)btn isLaunch:(BOOL)launch setTitle:(NSString *)title setLayerCornerRadius:(CGFloat)radius setFont:(CGFloat)Fon;
// 加载xib view
+ (UIView *)loadViewFormCtl:(UIViewController *)ctl view:(UIView *)view;

// 保存缓存
+ (void)saveCookies;

// 设置label属性
+ (void)setLabel:(UILabel *)label text:(NSString *)text textColor:(UIColor *)alertTextColor font:(CGFloat)size;

//判断字符串是否为空
+ (NSString *)validString:(NSString *)string;
+ (BOOL)isBlankString:(NSString *)string;
// 转场动画
+ (void)presentViewController:(NSString *)className ctl:(UIViewController *)ctl animationType:(WXSTransitionAnimationType)animationType isSysBackAnimation:(BOOL)isSysBackAnimation;





// 倒计时 按钮颜色变化
+ (void)setCountDown:(UIButton *)btn setLayerCornerRadius:(CGFloat)radius borderWidth:(CGFloat)width borderColor:(UIColor *)borderColor setBackgroundColor:(UIColor *)backgroundColor forState:(UIControlState)state;




//系统弹框
+ (void) alertAction:(SEL)selector alertControllerWithTitle:(NSString *)Title Message:(NSString *)message Vctl:(UIViewController *)Ctl Cancel:(BOOL)isCancel;


// 相册权限
+ (void)imagePickerPermissions:(UIViewController *)ctl didClickedButtonAtIndex:(NSInteger)index;


// 图片压缩
+ (UIImage*)imageWithImage:(UIImage*)image scaledToSize:(CGSize)newSize;

// 上传图片
+ (void)updatePortrait:(NSArray *)images name:(NSString *)name mimeType:(NSString *)mimeType upDataSucceed:(UPDatePortraitSuccessful)succeed upDataFail:(UPDatePortraitFail)fail;

// 发布纯文本
+ (void)shareSinaWeiboWithText:(NSString *)text ;

// 发布图片文字等。
+ (void)shareSinaWeiboWithText:(NSString *)text image:(UIImage *)image;

// 核实密码准确性
+ (pwdErrorType)enterPwd:(NSString *)newPwd resentPwd:(NSString *)resentPwd;

// 用于在自定义头部 尾部颜色设置
+ (UIImage *)imageWithColor:(UIColor *)color size:(CGSize)size alpha:(float)alpha;

// 判断是否手机登录
+ (BOOL)isPhoneLog;

// 判断账号是否符合要求
+ (BOOL)isAccount:(NSString *)account accountTy:(bingTy)ty;



// 返回
+ (void)pushAndPop:(NSString *)popView range:(NSRange )makeRange currentCtl:(UIViewController *)wSelf;





//二维码
+ (UIImage *)generateQrCode:(NSString *)qrCodeContent qrCodeAdress:(NSString *)qrCodeAdress qrCodeColorwithRed:(CGFloat)red andGreen:(CGFloat)green andBlue:(CGFloat)blue qrCodeSize:(CGFloat)qrCodeSize;

// 钱单位划算
// 钱=数据处理（个十百千万）
+ (NSString *)moneyWithInterge:(CGFloat)moneValue;

// 字典转字符串
+ (NSString*)dictionaryToJson:(NSDictionary *)dic;



//逆向遍历
+(NSMutableArray *)flashbackAry:(NSArray *)array;




// 判断两个数组是否相同
+(BOOL)isEqualToAry:(NSMutableArray *)oldArr newArr:(NSMutableArray *)newArr;

// 内存吃紧清理缓存
+ (void)clear;

@end
